
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>7.2 uniappx插件nutpi-idcard开发与使用指南 · uniapp/uniapp-x for Harmony教程</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="坚果派">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-mind-maps/mindmaps.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-emphasize/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-anchors/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ace/ace.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-theme-lou/lou.css">
                
            
        

    

    
        
        <link rel="stylesheet" href="../styles/website.css">
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.chinese-number-format插件.html" />
    
    
    <link rel="prev" href="1.开发鸿蒙插件.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"ITmxs/gitbook","types":["star","watch","fork"],"size":"small"};
    </script>

    </head>
    <body>
         
<div class="donate-modal modal">
  <div class="modal-header">
    <div>
      <span>
        <img
          id="modal-avatar"
          class="modal-avatar"
          src="http://xkapp-uat.oss-cn-hangzhou.aliyuncs.com/2e7a3f70-80ab-4b50-93ec-a04dfeef949b/avatar-100.png"
        />
      </span>
      <span id="nickname"> breeze </span>
      <p class="modal-close close" onclick="closeDonateModal()">×</p>
    </div>
    <div class="message">
      <div class="tip">
        <i></i>
        <span>随意打赏，但不要超过一顿早餐钱 💕</span>
      </div>
    </div>
  </div>
  <div class="modal-content">
    <div class="modal-pay-way">
      <div id="wxpay" onclick="showDonateImg(0)">
        <input
          type="radio"
          name="pay-way"
          value="wxpay"
          class="zs-type"
          checked="checked"
        />
        <span>
          <img
            id="wxpay-logo"
            src=""
          />
        </span>
      </div>
      <div id="alipay" onclick="showDonateImg(1)">
        <input type="radio" name="pay-way" value="alipay" class="zs-type" />
        <span>
          <img
            id="alipay-logo"
            src=""
          />
        </span>
      </div>
    </div>
    <div class="modal-pay-qrcode">
      <img id="wxpay-code" src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png" />
      <img
        id="alipay-code"
        src="https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202843746.png"
        hidden
      />
    </div>
  </div>
</div>
<div class="mask"></div>


<div class="book">
  <div class="header-inner">
    <!-- LOGO -->
    <div class="logo"></div>
    <span class="title"></span>

    <!-- Search -->
    
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>


    <!-- Nav -->
    <ul class="header-nav">
      <li>
        <a href="https://www.nutpi.net/" target="_blank">坚果派官网</a>
      </li><li>
        <a href="https://www.arkui.club/" target="_blank">ArkUI实战</a>
      </li><li>
        <a href="https://space.bilibili.com/480883651" target="_blank">元服务开发实践</a>
      </li><li>
        <a href="https://gitcode.com/nutpi" target="_blank">OpenHarmony应用开发</a>
      </li>
    </ul>
  </div>

  <div class="book-summary">
    <div class="book-summary-title">文档目录</div>
     
    <nav role="navigation">


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    1.前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../chapter2/1.为什么.html">
            
                <a href="../chapter2/1.为什么.html">
            
                    
                    2.为什么要这个专栏？
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" >
            
                <span>
            
                    
                    3.uniapp开发鸿蒙
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../chapter3/14.背景.md">
            
                <span>
            
                    
                    3.1背景
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../chapter3/15.优势.html">
            
                <a href="../chapter3/15.优势.html">
            
                    
                    3.2优势
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../chapter3/1.uniapp开发鸿蒙应用.html">
            
                <a href="../chapter3/1.uniapp开发鸿蒙应用.html">
            
                    
                    3.3uniapp开发鸿蒙应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../chapter3/3.uniapp之uts语言.html">
            
                <a href="../chapter3/3.uniapp之uts语言.html">
            
                    
                    3.4uniapp之uts语言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../chapter3/4.uniapp for Harmony.html">
            
                <a href="../chapter3/4.uniapp for Harmony.html">
            
                    
                    3.5uniapp for Harmony
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="../chapter3/5.uniapp for Harmony FAQ.html">
            
                <a href="../chapter3/5.uniapp for Harmony FAQ.html">
            
                    
                    3.6uniapp for Harmony FAQ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="../chapter3/2.uniapp2.html">
            
                <a href="../chapter3/2.uniapp2.html">
            
                    
                    3.7uniapp2
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.8" data-path="../chapter3/6.uniappx支持鸿蒙.html">
            
                <a href="../chapter3/6.uniappx支持鸿蒙.html">
            
                    
                    3.8uniappx支持鸿蒙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.9" data-path="../chapter3/7.uniapp-x支持鸿蒙.html">
            
                <a href="../chapter3/7.uniapp-x支持鸿蒙.html">
            
                    
                    3.9uniapp-x支持鸿蒙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.10" data-path="../chapter3/8.目前支持鸿蒙手机.html">
            
                <a href="../chapter3/8.目前支持鸿蒙手机.html">
            
                    
                    3.10目前支持鸿蒙手机
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.11" data-path="../chapter3/9.uniapp-x项目开发鸿蒙支持调试啦.html">
            
                <a href="../chapter3/9.uniapp-x项目开发鸿蒙支持调试啦.html">
            
                    
                    3.11uniapp-x项目开发鸿蒙支持调试啦
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.12" data-path="../chapter3/10.uniapp和flutter你会选哪个来开发鸿蒙.html">
            
                <a href="../chapter3/10.uniapp和flutter你会选哪个来开发鸿蒙.html">
            
                    
                    3.12uniapp和flutter你会选哪个来开发鸿蒙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.13" data-path="../chapter3/11.Flutter与uni-app的深度对比：鸿蒙开发的最佳选择竟是原生开发.md.md">
            
                <span>
            
                    
                    3.13Flutter与uni-app的深度对比：鸿蒙开发的最佳选择竟是原生开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.14" data-path="../chapter3/12.uniapp版本更新.html">
            
                <a href="../chapter3/12.uniapp版本更新.html">
            
                    
                    3.14uniapp版本更新
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.15" data-path="../chapter3/13.HBuilderX 4.62 开始，uni-app 支持嵌入鸿蒙原生组件.html">
            
                <a href="../chapter3/13.HBuilderX 4.62 开始，uni-app 支持嵌入鸿蒙原生组件.html">
            
                    
                    3.15HBuilderX 4.62开始，uni-app支持嵌入鸿蒙原生组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.16" data-path="../chapter3/16.uni-app x 已经完成鸿蒙等主流平台全覆盖.html">
            
                <a href="../chapter3/16.uni-app x 已经完成鸿蒙等主流平台全覆盖.html">
            
                    
                    3.16uni-app x 已经完成鸿蒙等主流平台全覆盖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.17" data-path="../chapter3/17.uniapp如何进行条件编译到鸿蒙.html">
            
                <a href="../chapter3/17.uniapp如何进行条件编译到鸿蒙.html">
            
                    
                    3.17uniapp如何进行条件编译到鸿蒙
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.18" data-path="../chapter3/18.鸿蒙Next案例分析.html">
            
                <a href="../chapter3/18.鸿蒙Next案例分析.html">
            
                    
                    3.18鸿蒙Next案例分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.19" data-path="../chapter3/19.UTS开发鸿蒙插件.md">
            
                <span>
            
                    
                    3.19UTS开发鸿蒙插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.20" data-path="../chapter3/20.热重载.html">
            
                <a href="../chapter3/20.热重载.html">
            
                    
                    3.20热重载
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.21" data-path="../chapter3/21.调用鸿蒙原生组件.html">
            
                <a href="../chapter3/21.调用鸿蒙原生组件.html">
            
                    
                    3.21调用鸿蒙原生组件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.22" data-path="../chapter3/22.从开发者视角看 uniapp 与 Flutter 的差异.html">
            
                <a href="../chapter3/22.从开发者视角看 uniapp 与 Flutter 的差异.html">
            
                    
                    3.22从开发者视角看 uniapp 与 Flutter 的差异
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.23" data-path="../chapter3/23.uniappforHarmony学习路线.html">
            
                <a href="../chapter3/23.uniappforHarmony学习路线.html">
            
                    
                    3.23uniappforHarmony学习路线
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" >
            
                <span>
            
                    
                    4.随机笑话-实战案例
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../chapter4/1.uni-app_x跨平台实战入门：从0到1开发HarmonyOS_5鸿蒙原生应用.html">
            
                <a href="../chapter4/1.uni-app_x跨平台实战入门：从0到1开发HarmonyOS_5鸿蒙原生应用.html">
            
                    
                    4.1 uni-app x 跨平台实战入门：从 0 到 1 开发 HarmonyOS 5 鸿蒙原生应用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" >
            
                <span>
            
                    
                    5.二十四节气
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" >
            
                <span>
            
                    
                    5.1二十四节气实战案例
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" >
            
                <span>
            
                    
                    6.UTS插件开发
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../chapter6/1.UTS开发鸿蒙插件.html">
            
                <a href="../chapter6/1.UTS开发鸿蒙插件.html">
            
                    
                    6.1 UTS开发鸿蒙插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../chapter6/2.开发uts插件.html">
            
                <a href="../chapter6/2.开发uts插件.html">
            
                    
                    6.2 开发uts插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../chapter6/3.新建鸿蒙插件.html">
            
                <a href="../chapter6/3.新建鸿蒙插件.html">
            
                    
                    6.3 新建鸿蒙插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../chapter6/4.鸿蒙使用插件.md">
            
                <span>
            
                    
                    6.4 鸿蒙使用插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" >
            
                <span>
            
                    
                    7.鸿蒙插件实战
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="1.开发鸿蒙插件.html">
            
                <a href="1.开发鸿蒙插件.html">
            
                    
                    7.1 开发鸿蒙插件
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.7.2" data-path="2.uniappx插件nutpi-idcard 开发与使用指南（适配鸿蒙）.html">
            
                <a href="2.uniappx插件nutpi-idcard 开发与使用指南（适配鸿蒙）.html">
            
                    
                    7.2 uniappx插件nutpi-idcard开发与使用指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="3.chinese-number-format插件.html">
            
                <a href="3.chinese-number-format插件.html">
            
                    
                    7.3 chinese-number-format插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="4.calendar插件.html">
            
                <a href="4.calendar插件.html">
            
                    
                    7.4 calendar插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="5.HBuilderX 中适配鸿蒙插件的安装使用指南.html">
            
                <a href="5.HBuilderX 中适配鸿蒙插件的安装使用指南.html">
            
                    
                    7.5 HBuilderX中适配鸿蒙插件的安装使用指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="OpenHarmony5.0跟华为HarmonyOS之间的应用生态兼容情况.html">
            
                <a href="OpenHarmony5.0跟华为HarmonyOS之间的应用生态兼容情况.html">
            
                    
                    7.6 OpenHarmony与HarmonyOS兼容性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>

</nav>
     
  </div>

  <!-- Content nav -->
  <div class="book-anchor">
    <div class="book-anchor-title"></div>

    <div class="book-anchor-body"></div>
  </div>

  <div class="book-body">
    
    <div class="body-inner">
       

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >7.2 uniappx插件nutpi-idcard开发与使用指南</a>
    </h1>
</div>



      <div class="page-wrapper" tabindex="-1" role="main">
        <div class="page-inner">
          
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
          <section class="normal markdown-section">
             
                <div id="vip-container">
                    <h1 id="uniappx&#x63D2;&#x4EF6;nutpi-idcard-&#x5F00;&#x53D1;&#x4E0E;&#x4F7F;&#x7528;&#x6307;&#x5357;&#xFF08;&#x9002;&#x914D;&#x9E3F;&#x8499;&#xFF09;"><a name="uniappx&#x63D2;&#x4EF6;nutpi-idcard-&#x5F00;&#x53D1;&#x4E0E;&#x4F7F;&#x7528;&#x6307;&#x5357;&#xFF08;&#x9002;&#x914D;&#x9E3F;&#x8499;&#xFF09;" class="plugin-anchor" href="#uniappx&#x63D2;&#x4EF6;nutpi-idcard-&#x5F00;&#x53D1;&#x4E0E;&#x4F7F;&#x7528;&#x6307;&#x5357;&#xFF08;&#x9002;&#x914D;&#x9E3F;&#x8499;&#xFF09;"><i class="fa fa-link" aria-hidden="true"></i></a>uniappx&#x63D2;&#x4EF6;nutpi-idcard &#x5F00;&#x53D1;&#x4E0E;&#x4F7F;&#x7528;&#x6307;&#x5357;&#xFF08;&#x9002;&#x914D;&#x9E3F;&#x8499;&#xFF09;</h1>
<h2 id="&#x524D;&#x8A00;"><a name="&#x524D;&#x8A00;" class="plugin-anchor" href="#&#x524D;&#x8A00;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x524D;&#x8A00;</h2>
<p><code>nutpi-idcard</code> &#x662F;&#x4E00;&#x4E2A;&#x57FA;&#x4E8E; UTS (uni-app TypeScript Syntax) &#x5F00;&#x53D1;&#x7684; uni-app &#x63D2;&#x4EF6;&#x9002;&#x914D;&#x9E3F;&#x8499;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x89E3;&#x6790;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#xFF0C;&#x63D0;&#x53D6;&#x5176;&#x4E2D;&#x7684;&#x5173;&#x952E;&#x4FE1;&#x606F;&#xFF0C;&#x5982;&#x5730;&#x533A;&#x3001;&#x51FA;&#x751F;&#x65E5;&#x671F;&#x3001;&#x6027;&#x522B;&#x7B49;&#x3002;&#x672C;&#x63D2;&#x4EF6;&#x652F;&#x6301;&#x4E2D;&#x56FD;&#x5C45;&#x6C11;&#x8EAB;&#x4EFD;&#x8BC1;&#x3001;&#x6E2F;&#x6FB3;&#x53F0;&#x5C45;&#x6C11;&#x5C45;&#x4F4F;&#x8BC1;&#x4EE5;&#x53CA;&#x5916;&#x56FD;&#x4EBA;&#x6C38;&#x4E45;&#x5C45;&#x7559;&#x8EAB;&#x4EFD;&#x8BC1;&#x3002;</p>
<p>&#x672C;&#x6587;&#x5C06;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD; <code>nutpi-idcard</code> &#x63D2;&#x4EF6;&#x7684;&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;&#x548C;&#x4F7F;&#x7528;&#x65B9;&#x6CD5;&#xFF0C;&#x5E0C;&#x671B;&#x80FD;&#x4E3A;&#x5176;&#x4ED6;&#x5F00;&#x53D1;&#x8005;&#x63D0;&#x4F9B;&#x4E00;&#x4E9B;&#x53C2;&#x8003;&#x3002;</p>
<h2 id="&#x63D2;&#x4EF6;&#x529F;&#x80FD;"><a name="&#x63D2;&#x4EF6;&#x529F;&#x80FD;" class="plugin-anchor" href="#&#x63D2;&#x4EF6;&#x529F;&#x80FD;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x63D2;&#x4EF6;&#x529F;&#x80FD;</h2>
<ul>
<li><strong>&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x89E3;&#x6790;</strong>&#xFF1A;&#x80FD;&#x591F;&#x4ECE;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x4E2D;&#x63D0;&#x53D6;&#x7701;&#x5E02;&#x533A;&#xFF08;&#x6216;&#x56FD;&#x5BB6;/&#x5730;&#x533A;&#xFF09;&#x3001;&#x51FA;&#x751F;&#x65E5;&#x671F;&#x3001;&#x6027;&#x522B;&#x7B49;&#x4FE1;&#x606F;&#x3002;</li>
<li><strong>&#x652F;&#x6301;&#x591A;&#x79CD;&#x8BC1;&#x4EF6;&#x7C7B;&#x578B;</strong>&#xFF1A;<ul>
<li>&#x4E2D;&#x56FD;&#x5C45;&#x6C11;&#x8EAB;&#x4EFD;&#x8BC1;</li>
<li>&#x6E2F;&#x6FB3;&#x53F0;&#x5C45;&#x6C11;&#x5C45;&#x4F4F;&#x8BC1;</li>
<li>&#x5916;&#x56FD;&#x4EBA;&#x6C38;&#x4E45;&#x5C45;&#x7559;&#x8EAB;&#x4EFD;&#x8BC1;</li>
</ul>
</li>
<li><strong>&#x7EAF; UTS &#x5B9E;&#x73B0;</strong>&#xFF1A;&#x786E;&#x4FDD;&#x4E86;&#x63D2;&#x4EF6;&#x5728; uni-app x &#x53CA;&#x5176;&#x4ED6;&#x652F;&#x6301; UTS &#x7684;&#x73AF;&#x5883;&#x4E2D;&#x7684;&#x517C;&#x5BB9;&#x6027;&#x548C;&#x6027;&#x80FD;&#x3002;</li>
<li><strong>&#x8DE8;&#x5E73;&#x53F0;&#x652F;&#x6301;</strong>&#xFF1A;&#x7406;&#x8BBA;&#x4E0A;&#x652F;&#x6301;&#x6240;&#x6709; uni-app &#x652F;&#x6301;&#x7684;&#x5E73;&#x53F0;&#xFF0C;&#x7279;&#x522B;&#x662F;&#x9488;&#x5BF9; App (Android, iOS, HarmonyOS) &#x8FDB;&#x884C;&#x4E86;&#x9002;&#x914D;&#x3002;</li>
</ul>
<h2 id="&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;"><a name="&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;" class="plugin-anchor" href="#&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;</h2>
<h3 id="1-&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x4E0E;&#x73AF;&#x5883;&#x642D;&#x5EFA;"><a name="1-&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x4E0E;&#x73AF;&#x5883;&#x642D;&#x5EFA;" class="plugin-anchor" href="#1-&#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x4E0E;&#x73AF;&#x5883;&#x642D;&#x5EFA;"><i class="fa fa-link" aria-hidden="true"></i></a>1. &#x9879;&#x76EE;&#x521D;&#x59CB;&#x5316;&#x4E0E;&#x73AF;&#x5883;&#x642D;&#x5EFA;</h3>
<p>&#x63D2;&#x4EF6;&#x7684;&#x5F00;&#x53D1;&#x57FA;&#x4E8E; HBuilderX&#xFF0C;&#x5229;&#x7528;&#x5176;&#x5BF9; uni-app &#x548C; UTS &#x7684;&#x826F;&#x597D;&#x652F;&#x6301;&#x3002;</p>
<ul>
<li><strong>&#x521B;&#x5EFA; uni-app &#x9879;&#x76EE;</strong>&#xFF1A;&#x9996;&#x5148;&#xFF0C;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6807;&#x51C6;&#x7684; uni-app &#x9879;&#x76EE;&#xFF08;&#x5982;&#x679C;&#x8FD8;&#x6CA1;&#x6709;&#x7684;&#x8BDD;&#xFF09;&#x3002;</li>
<li><strong>&#x521B;&#x5EFA; uni_module</strong>&#xFF1A;&#x5728;&#x9879;&#x76EE;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA; <code>uni_modules</code> &#x6587;&#x4EF6;&#x5939;&#xFF08;&#x5982;&#x679C;&#x4E0D;&#x5B58;&#x5728;&#xFF09;&#xFF0C;&#x7136;&#x540E;&#x5728;&#x5176;&#x4E2D;&#x521B;&#x5EFA; <code>nutpi-idcard</code> &#x6587;&#x4EF6;&#x5939;&#x4F5C;&#x4E3A;&#x63D2;&#x4EF6;&#x7684;&#x6839;&#x76EE;&#x5F55;&#x3002;</li>
<li><strong>&#x914D;&#x7F6E;&#x6587;&#x4EF6; <code>package.json</code></strong>&#xFF1A;&#x5728; <code>nutpi-idcard</code> &#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA; <code>package.json</code> &#x6587;&#x4EF6;&#xFF0C;&#x7528;&#x4E8E;&#x5B9A;&#x4E49;&#x63D2;&#x4EF6;&#x7684;&#x57FA;&#x672C;&#x4FE1;&#x606F;&#x3001;&#x4F9D;&#x8D56;&#x3001;&#x5E73;&#x53F0;&#x652F;&#x6301;&#x7B49;&#x3002;&#x5173;&#x952E;&#x914D;&#x7F6E;&#x9879;&#x5305;&#x62EC;&#xFF1A;<ul>
<li><code>id</code>: &#x63D2;&#x4EF6;&#x7684;&#x552F;&#x4E00;&#x6807;&#x8BC6;&#x3002;</li>
<li><code>displayName</code>: &#x63D2;&#x4EF6;&#x5728; HBuilderX &#x4E2D;&#x663E;&#x793A;&#x7684;&#x540D;&#x79F0;&#x3002;</li>
<li><code>version</code>: &#x63D2;&#x4EF6;&#x7248;&#x672C;&#x53F7;&#x3002;</li>
<li><code>description</code>: &#x63D2;&#x4EF6;&#x63CF;&#x8FF0;&#x3002;</li>
<li><code>author</code>: &#x4F5C;&#x8005;&#x4FE1;&#x606F;-&#x575A;&#x679C;&#x6D3E;&#x3002;</li>
<li><code>contact</code>: &#x8054;&#x7CFB;&#x65B9;&#x5F0F;&#x3002;</li>
<li><code>repository</code>: &#x4EE3;&#x7801;&#x4ED3;&#x5E93;&#x5730;&#x5740;&#x3002;</li>
<li><code>engines</code>: HBuilderX &#x7248;&#x672C;&#x8981;&#x6C42;&#x3002;</li>
<li><code>dcloudext</code>: DCloud &#x6269;&#x5C55;&#x914D;&#x7F6E;&#xFF0C;&#x5982;&#x63D2;&#x4EF6;&#x7C7B;&#x578B; (<code>uts</code>)&#x3001;&#x9500;&#x552E;&#x4FE1;&#x606F;&#x7B49;&#x3002;</li>
<li><code>uni_modules</code>: uni-app &#x6A21;&#x5757;&#x914D;&#x7F6E;&#xFF0C;&#x5982;&#x4F9D;&#x8D56;&#x3001;&#x52A0;&#x5BC6;&#x3001;&#x5E73;&#x53F0;&#x652F;&#x6301;&#x7B49;&#x3002;</li>
</ul>
</li>
</ul>
<h3 id="2-&#x6838;&#x5FC3;&#x903B;&#x8F91;&#x5B9E;&#x73B0;-utssdk"><a name="2-&#x6838;&#x5FC3;&#x903B;&#x8F91;&#x5B9E;&#x73B0;-utssdk" class="plugin-anchor" href="#2-&#x6838;&#x5FC3;&#x903B;&#x8F91;&#x5B9E;&#x73B0;-utssdk"><i class="fa fa-link" aria-hidden="true"></i></a>2. &#x6838;&#x5FC3;&#x903B;&#x8F91;&#x5B9E;&#x73B0; (<code>utssdk</code>)</h3>
<p>&#x63D2;&#x4EF6;&#x7684;&#x6838;&#x5FC3;&#x4EE3;&#x7801;&#x4F4D;&#x4E8E; <code>utssdk</code> &#x76EE;&#x5F55;&#x4E0B;&#xFF0C;&#x9488;&#x5BF9;&#x4E0D;&#x540C;&#x5E73;&#x53F0;&#x53EF;&#x4EE5;&#x6709;&#x4E0D;&#x540C;&#x7684;&#x5B9E;&#x73B0;&#xFF0C;&#x4F46;&#x672C;&#x9879;&#x76EE;&#x4E2D;&#x4E3B;&#x8981;&#x5173;&#x6CE8;&#x901A;&#x7528;&#x7684; UTS &#x5B9E;&#x73B0;&#xFF0C;&#x7279;&#x522B;&#x662F;&#x9488;&#x5BF9; HarmonyOS &#x7684;&#x9002;&#x914D;&#x3002;</p>
<ul>
<li><p><strong>&#x76EE;&#x5F55;&#x7ED3;&#x6784;</strong>&#xFF1A;</p>
<pre><code>nutpi-idcard/
&#x251C;&#x2500;&#x2500; utssdk/
&#x2502;   &#x251C;&#x2500;&#x2500; app-harmony/         # HarmonyOS &#x5E73;&#x53F0;&#x7279;&#x5B9A;&#x4EE3;&#x7801;
&#x2502;   &#x2502;   &#x251C;&#x2500;&#x2500; index.uts        # HarmonyOS &#x5165;&#x53E3;&#x53CA;&#x6838;&#x5FC3;&#x903B;&#x8F91;
&#x2502;   &#x2502;   &#x251C;&#x2500;&#x2500; interfaces.uts   # TypeScript &#x63A5;&#x53E3;&#x5B9A;&#x4E49;
&#x2502;   &#x2502;   &#x2514;&#x2500;&#x2500; module/
&#x2502;   &#x2502;       &#x2514;&#x2500;&#x2500; data/        # &#x6570;&#x636E;&#x6587;&#x4EF6; (&#x884C;&#x653F;&#x533A;&#x5212;&#x3001;&#x56FD;&#x5BB6;&#x4EE3;&#x7801;)
&#x2502;   &#x2502;           &#x251C;&#x2500;&#x2500; china.uts
&#x2502;   &#x2502;           &#x2514;&#x2500;&#x2500; international.uts
&#x2502;   &#x251C;&#x2500;&#x2500; app-android/       # Android &#x5E73;&#x53F0; (&#x5982;&#x679C;&#x9700;&#x8981;&#x7279;&#x5B9A;&#x5B9E;&#x73B0;)
&#x2502;   &#x251C;&#x2500;&#x2500; app-ios/           # iOS &#x5E73;&#x53F0; (&#x5982;&#x679C;&#x9700;&#x8981;&#x7279;&#x5B9A;&#x5B9E;&#x73B0;)
&#x2502;   &#x251C;&#x2500;&#x2500; index.uts          # &#x63D2;&#x4EF6;&#x4E3B;&#x5165;&#x53E3; (&#x901A;&#x5E38;&#x5BFC;&#x51FA;&#x5404;&#x5E73;&#x53F0;&#x5B9E;&#x73B0;)
&#x2502;   &#x2514;&#x2500;&#x2500; interfaces.uts     # &#x901A;&#x7528;&#x63A5;&#x53E3;&#x5B9A;&#x4E49;
&#x251C;&#x2500;&#x2500; package.json
&#x251C;&#x2500;&#x2500; readme.md
&#x2514;&#x2500;&#x2500; changelog.md
</code></pre></li>
<li><p><strong>&#x6570;&#x636E;&#x51C6;&#x5907; (<code>module/data/</code>)</strong>&#xFF1A;</p>
<ul>
<li><code>china.uts</code>: &#x5B58;&#x50A8;&#x4E2D;&#x56FD;&#x884C;&#x653F;&#x533A;&#x5212;&#x4EE3;&#x7801;&#x4E0E;&#x540D;&#x79F0;&#x7684;&#x6620;&#x5C04;&#x3002;</li>
<li><code>international.uts</code>: &#x5B58;&#x50A8; ISO 3166-1 &#x56FD;&#x5BB6;&#x4EE3;&#x7801;&#x4E0E;&#x540D;&#x79F0;&#x7684;&#x6620;&#x5C04;&#x3002;</li>
</ul>
</li>
<li><p><strong>&#x63A5;&#x53E3;&#x5B9A;&#x4E49; (<code>interfaces.uts</code>)</strong>&#xFF1A;
&#x5B9A;&#x4E49;&#x4E86;&#x8EAB;&#x4EFD;&#x8BC1;&#x89E3;&#x6790;&#x7ED3;&#x679C;&#x7684;&#x6570;&#x636E;&#x7ED3;&#x6784; <code>IDResult</code>&#x3002;</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">interface</span> IDResult {
    <span class="hljs-keyword">type</span>?: <span class="hljs-built_in">string</span>;       <span class="hljs-comment">// &#x8BC1;&#x4EF6;&#x7C7B;&#x578B;</span>
    sign?: <span class="hljs-built_in">string</span>;       <span class="hljs-comment">// &#x7B7E;&#x53D1;&#x673A;&#x5173;&#x6216;&#x5730;&#x533A;</span>
    country?: <span class="hljs-built_in">string</span>;    <span class="hljs-comment">// &#x56FD;&#x5BB6;&#x6216;&#x5730;&#x533A;</span>
    birthday?: <span class="hljs-built_in">string</span>;   <span class="hljs-comment">// &#x51FA;&#x751F;&#x65E5;&#x671F; (YYYY-MM-DD)</span>
    sex?: <span class="hljs-built_in">string</span>;        <span class="hljs-comment">// &#x6027;&#x522B; (&apos;&#x7537;&apos; &#x6216; &apos;&#x5973;&apos;)</span>
    isValid?: <span class="hljs-built_in">boolean</span>;   <span class="hljs-comment">// &#x6821;&#x9A8C;&#x7ED3;&#x679C; (&#x5F53;&#x524D;&#x7248;&#x672C;&#x7B80;&#x5355;&#x8FD4;&#x56DE; true)</span>
}
</code></pre>
</li>
<li><p><strong>&#x6838;&#x5FC3;&#x89E3;&#x6790;&#x903B;&#x8F91; (<code>app-harmony/index.uts</code>)</strong>&#xFF1A;
&#x8FD9;&#x662F;&#x63D2;&#x4EF6;&#x7684;&#x6838;&#x5FC3;&#xFF0C;&#x5305;&#x542B;&#x4E86;&#x4E3B;&#x8981;&#x7684;&#x89E3;&#x6790;&#x51FD;&#x6570;&#x3002;</p>
<ul>
<li><code>parseID(id: string): IDResult</code>: &#x516C;&#x5F00;&#x7684; API &#x51FD;&#x6570;&#xFF0C;&#x6839;&#x636E;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x7684;&#x683C;&#x5F0F;&#xFF08;&#x901A;&#x8FC7;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x5224;&#x65AD;&#xFF09;&#x8C03;&#x7528;&#x76F8;&#x5E94;&#x7684;&#x5185;&#x90E8;&#x89E3;&#x6790;&#x51FD;&#x6570;&#x3002;</li>
<li><code>parserChina(id: string): IDResult</code>: &#x89E3;&#x6790;&#x4E2D;&#x56FD;&#x5C45;&#x6C11;&#x8EAB;&#x4EFD;&#x8BC1;&#x548C;&#x6E2F;&#x6FB3;&#x53F0;&#x5C45;&#x6C11;&#x5C45;&#x4F4F;&#x8BC1;&#x3002;<ul>
<li>&#x901A;&#x8FC7;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x7684;&#x524D;6&#x4F4D;&#x786E;&#x5B9A;&#x7701;&#x5E02;&#x533A;&#x3002;</li>
<li>&#x901A;&#x8FC7;&#x7B2C;7&#x5230;14&#x4F4D;&#x786E;&#x5B9A;&#x51FA;&#x751F;&#x65E5;&#x671F;&#x3002;</li>
<li>&#x901A;&#x8FC7;&#x7B2C;17&#x4F4D;&#xFF08;&#x987A;&#x5E8F;&#x7801;&#x7684;&#x6700;&#x540E;&#x4E00;&#x4F4D;&#xFF09;&#x786E;&#x5B9A;&#x6027;&#x522B;&#x3002;</li>
</ul>
</li>
<li><code>parserInternational(id: string): IDResult</code>: &#x89E3;&#x6790;&#x5916;&#x56FD;&#x4EBA;&#x6C38;&#x4E45;&#x5C45;&#x7559;&#x8EAB;&#x4EFD;&#x8BC1;&#x3002;<ul>
<li>&#x901A;&#x8FC7;&#x7B2C;1&#x5230;3&#x4F4D;&#xFF08;&#x56FD;&#x5BB6;&#x6216;&#x5730;&#x533A;&#x4EE3;&#x7801;&#xFF09;&#x548C; <code>international.uts</code> &#x6570;&#x636E;&#x786E;&#x5B9A;&#x56FD;&#x5BB6;&#x3002;</li>
<li>&#x901A;&#x8FC7;&#x7B2C;7&#x5230;14&#x4F4D;&#x786E;&#x5B9A;&#x51FA;&#x751F;&#x65E5;&#x671F;&#x3002;</li>
<li>&#x901A;&#x8FC7;&#x7B2C;17&#x4F4D;&#x786E;&#x5B9A;&#x6027;&#x522B;&#x3002;</li>
</ul>
</li>
<li><code>isIdCardValidInternal(id: string): boolean</code>: &#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x6709;&#x6548;&#x6027;&#x6821;&#x9A8C;&#x51FD;&#x6570;&#x3002;&#x76EE;&#x524D;&#x7B80;&#x5355;&#x8FD4;&#x56DE; <code>true</code>&#xFF0C;&#x672A;&#x6765;&#x53EF;&#x4EE5;&#x6839;&#x636E;&#x56FD;&#x5BB6;&#x6807;&#x51C6;&#x5B9E;&#x73B0;&#x66F4;&#x590D;&#x6742;&#x7684;&#x6821;&#x9A8C;&#x903B;&#x8F91;&#xFF08;&#x5982;&#x6821;&#x9A8C;&#x7801;&#x8BA1;&#x7B97;&#xFF09;&#x3002;</li>
</ul>
<pre><code class="lang-typescript"><span class="hljs-comment">// idcard/uni_modules/nutpi-idcard/utssdk/app-harmony/index.uts</span>
<span class="hljs-keyword">import</span> { chinaData as _china } from <span class="hljs-string">&apos;./module/data/china.uts&apos;</span>;
<span class="hljs-keyword">import</span> { internationalData as _international } from <span class="hljs-string">&apos;./module/data/international.uts&apos;</span>;
<span class="hljs-keyword">import</span> <span class="hljs-keyword">type</span> { IDResult } from <span class="hljs-string">&apos;./interfaces.uts&apos;</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">parserInternational</span>(<span class="hljs-params">id: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">IDResult</span> </span>{ <span class="hljs-comment">/* ... */</span> }
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">parserChina</span>(<span class="hljs-params">id: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">IDResult</span> </span>{ <span class="hljs-comment">/* ... */</span> }
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">isIdCardValidInternal</span>(<span class="hljs-params">id: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">boolean</span> </span>{ <span class="hljs-comment">/* ... */</span> }

<span class="hljs-keyword">export</span> <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">parseID</span>(<span class="hljs-params">id: <span class="hljs-built_in">string</span></span>): <span class="hljs-title">IDResult</span> </span>{
    <span class="hljs-keyword">if</span>(id.match(<span class="hljs-regexp">/^9\d{16}[0-9xX]$/</span>)){ <span class="hljs-comment">// &#x5916;&#x56FD;&#x4EBA;&#x6C38;&#x4E45;&#x5C45;&#x7559;&#x8EAB;&#x4EFD;&#x8BC1;&#x7279;&#x5F81; (&#x5047;&#x8BBE;&#x4EE5;9&#x5F00;&#x5934;)</span>
        <span class="hljs-keyword">return</span> parserInternational(id);
    }<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span>(id.match(<span class="hljs-regexp">/^\d{17}[0-9xX]$/</span>)){ <span class="hljs-comment">// &#x4E2D;&#x56FD;&#x5C45;&#x6C11;&#x8EAB;&#x4EFD;&#x8BC1;&#x7279;&#x5F81;</span>
        <span class="hljs-keyword">return</span> parserChina(id);
    }<span class="hljs-keyword">else</span>{
        <span class="hljs-keyword">return</span> { <span class="hljs-keyword">type</span>: <span class="hljs-string">&apos;&#x672A;&#x77E5;&#x7C7B;&#x578B;&apos;</span> };
    }
}
</code></pre>
</li>
</ul>
<h3 id="3-&#x63D2;&#x4EF6;&#x5165;&#x53E3;-indexuts"><a name="3-&#x63D2;&#x4EF6;&#x5165;&#x53E3;-indexuts" class="plugin-anchor" href="#3-&#x63D2;&#x4EF6;&#x5165;&#x53E3;-indexuts"><i class="fa fa-link" aria-hidden="true"></i></a>3. &#x63D2;&#x4EF6;&#x5165;&#x53E3; (<code>index.uts</code>)</h3>
<p>&#x5728; <code>nutpi-idcard</code> &#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x7684; <code>index.uts</code> &#x6587;&#x4EF6;&#x901A;&#x5E38;&#x4F5C;&#x4E3A;&#x63D2;&#x4EF6;&#x7684;&#x7EDF;&#x4E00;&#x5165;&#x53E3;&#xFF0C;&#x5B83;&#x4F1A;&#x6839;&#x636E;&#x5F53;&#x524D;&#x8FD0;&#x884C;&#x5E73;&#x53F0;&#x5BFC;&#x51FA;&#x76F8;&#x5E94;&#x5E73;&#x53F0;&#x7684; <code>parseID</code> &#x51FD;&#x6570;&#x3002;</p>
<pre><code class="lang-typescript"><span class="hljs-comment">// idcard/uni_modules/nutpi-idcard/index.uts</span>
<span class="hljs-comment">// #ifdef APP-HARMONY</span>
<span class="hljs-keyword">export</span> * from <span class="hljs-string">&apos;./utssdk/app-harmony/index.uts&apos;</span>;
<span class="hljs-comment">// #endif</span>

<span class="hljs-comment">// #ifdef APP-PLUS || APP-VUE</span>
<span class="hljs-comment">// &#x5047;&#x8BBE; Android &#x548C; iOS &#x4F7F;&#x7528;&#x76F8;&#x540C;&#x7684; UTS &#x903B;&#x8F91;&#xFF0C;&#x6216;&#x8005;&#x6709;&#x5355;&#x72EC;&#x7684; app-android/index.uts &#x548C; app-ios/index.uts</span>
<span class="hljs-comment">// &#x5982;&#x679C; utssdk/index.uts &#x5305;&#x542B;&#x4E86; Android &#x548C; iOS &#x7684;&#x901A;&#x7528;&#x903B;&#x8F91;&#xFF0C;&#x53EF;&#x4EE5;&#x8FD9;&#x6837;&#x5BFC;&#x51FA;&#xFF1A;</span>
<span class="hljs-comment">// export * from &apos;./utssdk/index.uts&apos;; </span>
<span class="hljs-comment">// &#x6216;&#x8005;&#x5206;&#x522B;&#x5BFC;&#x51FA;</span>
<span class="hljs-comment">// #ifdef APP-ANDROID</span>
<span class="hljs-comment">// export * from &apos;./utssdk/app-android/index.uts&apos;;</span>
<span class="hljs-comment">// #endif</span>
<span class="hljs-comment">// #ifdef APP-IOS</span>
<span class="hljs-comment">// export * from &apos;./utssdk/app-ios/index.uts&apos;;</span>
<span class="hljs-comment">// #endif</span>
<span class="hljs-comment">// #endif</span>

<span class="hljs-comment">// &#x9ED8;&#x8BA4;&#x5BFC;&#x51FA; (&#x5982;&#x679C;&#x9700;&#x8981;&#x5728;&#x975E;&#x7279;&#x5B9A;App&#x5E73;&#x53F0;&#x4F7F;&#x7528;&#xFF0C;&#x6216;&#x8005;&#x4F5C;&#x4E3A;H5&#x7B49;&#x5E73;&#x53F0;&#x7684;&#x515C;&#x5E95;)</span>
<span class="hljs-comment">// export * from &apos;./utssdk/index.uts&apos;; // &#x5047;&#x8BBE; utssdk/index.uts &#x5305;&#x542B;&#x901A;&#x7528;&#x6216;web&#x5B9E;&#x73B0;</span>
</code></pre>
<p><em>&#x6CE8;&#x610F;&#xFF1A;&#x4E0A;&#x8FF0; <code>index.uts</code> &#x7684;&#x6761;&#x4EF6;&#x7F16;&#x8BD1;&#x90E8;&#x5206;&#x9700;&#x8981;&#x6839;&#x636E;&#x5B9E;&#x9645;&#x652F;&#x6301;&#x7684;&#x5E73;&#x53F0;&#x548C;&#x4EE3;&#x7801;&#x7EC4;&#x7EC7;&#x6765;&#x7F16;&#x5199;&#x3002;&#x5982;&#x679C;&#x4E3B;&#x8981;&#x76EE;&#x6807;&#x662F; HarmonyOS&#xFF0C;&#x5219; <code>APP-HARMONY</code> &#x90E8;&#x5206;&#x662F;&#x5173;&#x952E;&#x3002;</em></p>
<h3 id="4-&#x6587;&#x6863;&#x7F16;&#x5199;"><a name="4-&#x6587;&#x6863;&#x7F16;&#x5199;" class="plugin-anchor" href="#4-&#x6587;&#x6863;&#x7F16;&#x5199;"><i class="fa fa-link" aria-hidden="true"></i></a>4. &#x6587;&#x6863;&#x7F16;&#x5199;</h3>
<ul>
<li><strong><code>readme.md</code></strong>: &#x63D0;&#x4F9B;&#x63D2;&#x4EF6;&#x7684;&#x8BE6;&#x7EC6;&#x8BF4;&#x660E;&#xFF0C;&#x5305;&#x62EC;&#x529F;&#x80FD;&#x7279;&#x6027;&#x3001;&#x5B89;&#x88C5;&#x65B9;&#x6CD5;&#x3001;API &#x6587;&#x6863;&#x3001;&#x4F7F;&#x7528;&#x793A;&#x4F8B;&#x3001;&#x4F5C;&#x8005;&#x4FE1;&#x606F;&#x7B49;&#x3002;</li>
<li><strong><code>changelog.md</code></strong>: &#x8BB0;&#x5F55;&#x63D2;&#x4EF6;&#x7684;&#x7248;&#x672C;&#x66F4;&#x65B0;&#x5386;&#x53F2;&#x548C;&#x4E3B;&#x8981;&#x53D8;&#x66F4;&#x3002;</li>
</ul>
<h3 id="5-&#x6D4B;&#x8BD5;&#x4E0E;&#x8C03;&#x8BD5;"><a name="5-&#x6D4B;&#x8BD5;&#x4E0E;&#x8C03;&#x8BD5;" class="plugin-anchor" href="#5-&#x6D4B;&#x8BD5;&#x4E0E;&#x8C03;&#x8BD5;"><i class="fa fa-link" aria-hidden="true"></i></a>5. &#x6D4B;&#x8BD5;&#x4E0E;&#x8C03;&#x8BD5;</h3>
<ul>
<li>&#x5728; HBuilderX &#x4E2D;&#x521B;&#x5EFA;&#x6D4B;&#x8BD5;&#x9875;&#x9762;&#xFF0C;&#x5F15;&#x5165;&#x63D2;&#x4EF6;&#x5E76;&#x8C03;&#x7528; <code>parseID</code> &#x51FD;&#x6570;&#xFF0C;&#x4F20;&#x5165;&#x4E0D;&#x540C;&#x7684;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x8FDB;&#x884C;&#x6D4B;&#x8BD5;&#x3002;</li>
<li>&#x5173;&#x6CE8;&#x63A7;&#x5236;&#x53F0;&#x8F93;&#x51FA;&#xFF0C;&#x786E;&#x4FDD;&#x89E3;&#x6790;&#x7ED3;&#x679C;&#x7684;&#x51C6;&#x786E;&#x6027;&#x3002;</li>
<li>&#x9488;&#x5BF9;&#x4E0D;&#x540C;&#x5E73;&#x53F0;&#xFF08;&#x7279;&#x522B;&#x662F; HarmonyOS&#xFF09;&#x8FDB;&#x884C;&#x771F;&#x673A;&#x6216;&#x6A21;&#x62DF;&#x5668;&#x6D4B;&#x8BD5;&#x3002;</li>
</ul>
<h3 id="&#x9047;&#x5230;&#x7684;&#x95EE;&#x9898;&#x4E0E;&#x89E3;&#x51B3;"><a name="&#x9047;&#x5230;&#x7684;&#x95EE;&#x9898;&#x4E0E;&#x89E3;&#x51B3;" class="plugin-anchor" href="#&#x9047;&#x5230;&#x7684;&#x95EE;&#x9898;&#x4E0E;&#x89E3;&#x51B3;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x9047;&#x5230;&#x7684;&#x95EE;&#x9898;&#x4E0E;&#x89E3;&#x51B3;</h3>
<ul>
<li><strong>UTS &#x6A21;&#x5757;&#x5BFC;&#x5165;&#x8DEF;&#x5F84;</strong>&#xFF1A;UTS &#x4E2D;&#x6A21;&#x5757;&#x5BFC;&#x5165;&#x8DEF;&#x5F84;&#x9700;&#x8981;&#x7CBE;&#x786E;&#x3002;&#x6700;&#x521D;&#x53EF;&#x80FD;&#x56E0;&#x4E3A; <code>method.uts</code> &#x548C; <code>index.uts</code> &#x7684;&#x62C6;&#x5206;&#x5BFC;&#x81F4;&#x51FD;&#x6570;&#x91CD;&#x590D;&#x58F0;&#x660E;&#x6216;&#x627E;&#x4E0D;&#x5230;&#x5B9A;&#x4E49;&#x7684;&#x95EE;&#x9898;&#x3002;&#x901A;&#x8FC7;&#x5C06; <code>method.uts</code> &#x7684;&#x5185;&#x5BB9;&#x5408;&#x5E76;&#x5230; <code>index.uts</code> &#x4E2D;&#x89E3;&#x51B3;&#x4E86;&#x6B64;&#x95EE;&#x9898;&#x3002;</li>
<li><strong>Git &#x63A8;&#x9001;&#x6807;&#x7B7E;&#x5931;&#x8D25;</strong>&#xFF1A;&#x5728;&#x7248;&#x672C;&#x53D1;&#x5E03;&#x65F6;&#xFF0C;&#x5982;&#x679C;&#x672C;&#x5730;&#x6CA1;&#x6709;&#x5BF9;&#x5E94;&#x7684; Git &#x6807;&#x7B7E;&#xFF0C;<code>git push origin &lt;tagname&gt;</code> &#x4F1A;&#x5931;&#x8D25;&#x3002;&#x901A;&#x8FC7;&#x5148;&#x6267;&#x884C; <code>git tag &lt;tagname&gt;</code> &#x521B;&#x5EFA;&#x672C;&#x5730;&#x6807;&#x7B7E;&#xFF0C;&#x7136;&#x540E;&#x518D;&#x63A8;&#x9001;&#x89E3;&#x51B3;&#x3002;</li>
<li><strong>&#x51FD;&#x6570;&#x672A;&#x5B9A;&#x4E49;&#x9519;&#x8BEF;</strong>&#xFF1A;&#x5728;&#x9875;&#x9762;&#x4E2D;&#x8C03;&#x7528;&#x63D2;&#x4EF6;&#x51FD;&#x6570;&#x65F6;&#xFF0C;&#x5982;&#x679C;&#x5BFC;&#x5165;&#x8DEF;&#x5F84;&#x4E0D;&#x6B63;&#x786E;&#x6216;&#x63D2;&#x4EF6;&#x672A;&#x6B63;&#x786E;&#x5BFC;&#x51FA;&#x51FD;&#x6570;&#xFF0C;&#x4F1A;&#x5BFC;&#x81F4; <code>xxx is not defined</code> &#x9519;&#x8BEF;&#x3002;&#x4ED4;&#x7EC6;&#x68C0;&#x67E5;&#x63D2;&#x4EF6;&#x7684; <code>index.uts</code> &#x5BFC;&#x51FA;&#x903B;&#x8F91;&#x548C;&#x9875;&#x9762;&#x4E2D;&#x7684;&#x5BFC;&#x5165;&#x8DEF;&#x5F84;&#xFF0C;&#x786E;&#x4FDD;&#x4E00;&#x81F4;&#x3002;</li>
</ul>
<h2 id="&#x5982;&#x4F55;&#x4F7F;&#x7528;-nutpi-idcard-&#x63D2;&#x4EF6;"><a name="&#x5982;&#x4F55;&#x4F7F;&#x7528;-nutpi-idcard-&#x63D2;&#x4EF6;" class="plugin-anchor" href="#&#x5982;&#x4F55;&#x4F7F;&#x7528;-nutpi-idcard-&#x63D2;&#x4EF6;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x5982;&#x4F55;&#x4F7F;&#x7528; <code>nutpi-idcard</code> &#x63D2;&#x4EF6;</h2>
<ol>
<li><p><strong>&#x5B89;&#x88C5;&#x63D2;&#x4EF6;</strong>&#xFF1A;</p>
<ul>
<li>&#x4ECE; DCloud &#x63D2;&#x4EF6;&#x5E02;&#x573A;&#x5B89;&#x88C5;&#x3002;&#x63D2;&#x4EF6;&#x5730;&#x5740;&#xFF1A;<a href="https://ext.dcloud.net.cn/plugin?id=23728" target="_blank">https://ext.dcloud.net.cn/plugin?id=23728</a></li>
<li>&#x6216;&#x8005;&#xFF0C;&#x5982;&#x679C;&#x624B;&#x52A8;&#x5F15;&#x5165;&#xFF0C;&#x5C06; <code>nutpi-idcard</code> &#x6574;&#x4E2A;&#x6587;&#x4EF6;&#x5939;&#x590D;&#x5236;&#x5230;&#x4F60;&#x7684; uni-app &#x9879;&#x76EE;&#x7684; <code>uni_modules</code> &#x76EE;&#x5F55;&#x4E0B;&#x3002;</li>
</ul>
</li>
<li><p><strong>&#x5F15;&#x5165;&#x63D2;&#x4EF6;</strong>&#xFF1A;&#x5728;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x7684;&#x9875;&#x9762;&#x6216;&#x7EC4;&#x4EF6;&#x7684; <code>&lt;script setup lang=&quot;uts&quot;&gt;</code> &#x6216; <code>&lt;script lang=&quot;uts&quot;&gt;</code> &#x4E2D;&#x5F15;&#x5165;&#x63D2;&#x4EF6;&#x3002;</p>
<pre><code class="lang-typescript"><span class="hljs-comment">// &#x793A;&#x4F8B;&#xFF1A;&#x5728;&#x9875;&#x9762;&#x7684; &lt;script setup lang=&quot;uts&quot;&gt; &#x4E2D;</span>
<span class="hljs-keyword">import</span> { parseID } from <span class="hljs-string">&apos;@/uni_modules/nutpi-idcard&apos;</span>; <span class="hljs-comment">// HBuilderX &#x4F1A;&#x81EA;&#x52A8;&#x5904;&#x7406;&#x8DEF;&#x5F84;&#x6620;&#x5C04;</span>
<span class="hljs-comment">// &#x5982;&#x679C;&#x5728; uni-app x &#x9879;&#x76EE;&#x7684; .uvue &#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x8DEF;&#x5F84;&#x53EF;&#x80FD;&#x9700;&#x8981;&#x66F4;&#x660E;&#x786E;&#xFF0C;&#x6216;&#x8005;&#x4F9D;&#x8D56; HBuilderX &#x7684;&#x667A;&#x80FD;&#x63D0;&#x793A;</span>
</code></pre>
</li>
<li><p><strong>&#x8C03;&#x7528;&#x89E3;&#x6790;&#x51FD;&#x6570;</strong>&#xFF1A;&#x4F7F;&#x7528; <code>parseID</code> &#x51FD;&#x6570;&#x89E3;&#x6790;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x3002;</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">const</span> idNumber = <span class="hljs-string">&apos;110101199003070978&apos;</span>; <span class="hljs-comment">// &#x66FF;&#x6362;&#x4E3A;&#x5B9E;&#x9645;&#x7684;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;</span>
<span class="hljs-keyword">const</span> idInfo = parseID(idNumber);

<span class="hljs-keyword">if</span> (idInfo) {
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x8BC1;&#x4EF6;&#x7C7B;&#x578B;:&apos;</span>, idInfo.type);
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x7B7E;&#x53D1;&#x5730;/&#x56FD;&#x5BB6;:&apos;</span>, idInfo.sign ?? idInfo.country);
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x51FA;&#x751F;&#x65E5;&#x671F;:&apos;</span>, idInfo.birthday);
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x6027;&#x522B;:&apos;</span>, idInfo.sex);
    <span class="hljs-built_in">console</span>.log(<span class="hljs-string">&apos;&#x662F;&#x5426;&#x6709;&#x6548;:&apos;</span>, idInfo.isValid);
}
</code></pre>
</li>
</ol>
<h2 id="api-&#x53C2;&#x8003;"><a name="api-&#x53C2;&#x8003;" class="plugin-anchor" href="#api-&#x53C2;&#x8003;"><i class="fa fa-link" aria-hidden="true"></i></a>API &#x53C2;&#x8003;</h2>
<h3 id="parseidid-string-idresult"><a name="parseidid-string-idresult" class="plugin-anchor" href="#parseidid-string-idresult"><i class="fa fa-link" aria-hidden="true"></i></a><code>parseID(id: string): IDResult</code></h3>
<p>&#x89E3;&#x6790;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x5E76;&#x8FD4;&#x56DE;&#x5305;&#x542B;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#x7684;&#x5BF9;&#x8C61;&#x3002;</p>
<ul>
<li><p><strong>&#x53C2;&#x6570;</strong>&#xFF1A;</p>
<ul>
<li><code>id: string</code> - &#x9700;&#x8981;&#x89E3;&#x6790;&#x7684;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#xFF08;18&#x4F4D;&#x4E2D;&#x56FD;&#x5C45;&#x6C11;&#x8EAB;&#x4EFD;&#x8BC1;&#xFF0C;&#x6216;&#x5916;&#x56FD;&#x4EBA;&#x6C38;&#x4E45;&#x5C45;&#x7559;&#x8EAB;&#x4EFD;&#x8BC1;&#x7B49;&#xFF09;&#x3002;</li>
</ul>
</li>
<li><p><strong>&#x8FD4;&#x56DE;&#x503C;</strong>&#xFF1A;<code>IDResult</code> &#x5BF9;&#x8C61;&#xFF0C;&#x5176;&#x7ED3;&#x6784;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">interface</span> IDResult {
    <span class="hljs-keyword">type</span>?: <span class="hljs-built_in">string</span>;       <span class="hljs-comment">// &#x8BC1;&#x4EF6;&#x7C7B;&#x578B; (&#x4F8B;&#x5982;&#xFF1A;&apos;&#x5C45;&#x6C11;&#x8EAB;&#x4EFD;&#x8BC1;&apos;, &apos;&#x5916;&#x56FD;&#x4EBA;&#x6C38;&#x4E45;&#x5C45;&#x7559;&#x8EAB;&#x4EFD;&#x8BC1;&apos;, &apos;&#x6E2F;&#x6FB3;&#x53F0;&#x5C45;&#x6C11;&#x5C45;&#x4F4F;&#x8BC1;&apos;, &apos;&#x672A;&#x77E5;&#x7C7B;&#x578B;&apos;)</span>
    sign?: <span class="hljs-built_in">string</span>;       <span class="hljs-comment">// &#x7B7E;&#x53D1;&#x673A;&#x5173;&#x6216;&#x5730;&#x533A;&#x4FE1;&#x606F; (&#x4F8B;&#x5982;&#xFF1A;&apos;&#x5317;&#x4EAC;&#x5E02;&#x5E02;&#x8F96;&#x533A;&apos;, &apos;&#x5317;&#x4EAC;&#x5E02;&#x671D;&#x9633;&#x533A;&apos;)</span>
    country?: <span class="hljs-built_in">string</span>;    <span class="hljs-comment">// &#x56FD;&#x5BB6;&#x6216;&#x5730;&#x533A; (&#x4F8B;&#x5982;&#xFF1A;&apos;&#x4E2D;&#x56FD;&apos;, &apos;&#x65E0;&#x56FD;&#x7C4D;&apos; &#x6216;&#x5176;&#x4ED6;&#x56FD;&#x5BB6;&#x540D;&#x79F0;&#xFF0C;&#x4E3B;&#x8981;&#x7528;&#x4E8E;&#x5916;&#x56FD;&#x4EBA;&#x8EAB;&#x4EFD;&#x8BC1;)</span>
    birthday?: <span class="hljs-built_in">string</span>;   <span class="hljs-comment">// &#x51FA;&#x751F;&#x65E5;&#x671F;&#xFF0C;&#x683C;&#x5F0F;&#x4E3A; &apos;YYYY-MM-DD&apos;</span>
    sex?: <span class="hljs-built_in">string</span>;        <span class="hljs-comment">// &#x6027;&#x522B; (&apos;&#x7537;&apos; &#x6216; &apos;&#x5973;&apos;)</span>
    isValid?: <span class="hljs-built_in">boolean</span>;   <span class="hljs-comment">// &#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x662F;&#x5426;&#x6709;&#x6548; (&#x5F53;&#x524D;&#x7248;&#x672C;&#x7B80;&#x5355;&#x8FD4;&#x56DE;true&#xFF0C;&#x5F85;&#x5B9E;&#x73B0;&#x8BE6;&#x7EC6;&#x6821;&#x9A8C;&#x903B;&#x8F91;)</span>
}
</code></pre>
</li>
</ul>
<h2 id="&#x672A;&#x6765;&#x5C55;&#x671B;"><a name="&#x672A;&#x6765;&#x5C55;&#x671B;" class="plugin-anchor" href="#&#x672A;&#x6765;&#x5C55;&#x671B;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x672A;&#x6765;&#x5C55;&#x671B;</h2>
<ul>
<li><strong>&#x5B8C;&#x5584;&#x6821;&#x9A8C;&#x903B;&#x8F91;</strong>&#xFF1A;&#x5B9E;&#x73B0;&#x66F4;&#x4E25;&#x683C;&#x7684;&#x8EAB;&#x4EFD;&#x8BC1;&#x53F7;&#x7801;&#x6821;&#x9A8C;&#xFF0C;&#x5305;&#x62EC;&#x6821;&#x9A8C;&#x7801;&#x7684;&#x8BA1;&#x7B97;&#x4E0E;&#x9A8C;&#x8BC1;&#x3002;</li>
<li><strong>&#x66F4;&#x5E7F;&#x6CDB;&#x7684;&#x8BC1;&#x4EF6;&#x7C7B;&#x578B;&#x652F;&#x6301;</strong>&#xFF1A;&#x8003;&#x8651;&#x652F;&#x6301;&#x66F4;&#x591A;&#x56FD;&#x5BB6;&#x6216;&#x5730;&#x533A;&#x7684;&#x8EAB;&#x4EFD;&#x8BC1;&#x4EF6;&#x7C7B;&#x578B;&#x3002;</li>
<li><strong>&#x6027;&#x80FD;&#x4F18;&#x5316;</strong>&#xFF1A;&#x5BF9;&#x6570;&#x636E;&#x67E5;&#x627E;&#x548C;&#x5B57;&#x7B26;&#x4E32;&#x5904;&#x7406;&#x8FDB;&#x884C;&#x4F18;&#x5316;&#xFF0C;&#x63D0;&#x9AD8;&#x89E3;&#x6790;&#x6548;&#x7387;&#x3002;</li>
<li><strong>&#x66F4;&#x8BE6;&#x7EC6;&#x7684;&#x9519;&#x8BEF;&#x63D0;&#x793A;</strong>&#xFF1A;&#x5F53;&#x8F93;&#x5165;&#x683C;&#x5F0F;&#x9519;&#x8BEF;&#x6216;&#x65E0;&#x6CD5;&#x89E3;&#x6790;&#x65F6;&#xFF0C;&#x63D0;&#x4F9B;&#x66F4;&#x5177;&#x4F53;&#x7684;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#x3002;</li>
<li><strong>&#x5355;&#x5143;&#x6D4B;&#x8BD5;</strong>&#xFF1A;&#x4E3A;&#x63D2;&#x4EF6;&#x7F16;&#x5199;&#x5B8C;&#x5584;&#x7684;&#x5355;&#x5143;&#x6D4B;&#x8BD5;&#xFF0C;&#x786E;&#x4FDD;&#x4EE3;&#x7801;&#x8D28;&#x91CF;&#x548C;&#x7A33;&#x5B9A;&#x6027;&#x3002;</li>
</ul>
<h2 id="&#x4F5C;&#x8005;&#x4E0E;&#x8054;&#x7CFB;&#x65B9;&#x5F0F;"><a name="&#x4F5C;&#x8005;&#x4E0E;&#x8054;&#x7CFB;&#x65B9;&#x5F0F;" class="plugin-anchor" href="#&#x4F5C;&#x8005;&#x4E0E;&#x8054;&#x7CFB;&#x65B9;&#x5F0F;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x4F5C;&#x8005;&#x4E0E;&#x8054;&#x7CFB;&#x65B9;&#x5F0F;</h2>
<ul>
<li><strong>&#x4F5C;&#x8005;</strong>&#xFF1A;&#x575A;&#x679C;&#x6D3E;</li>
<li><strong>&#x516C;&#x4F17;&#x53F7;</strong>&#xFF1A;nutpi</li>
<li><strong>&#x7535;&#x8BDD;</strong>&#xFF1A;17752170152</li>
<li><strong>&#x5B98;&#x7F51;</strong>&#xFF1A;<a href="https://www.nutpi.net/" target="_blank">https://www.nutpi.net/</a></li>
<li><strong>&#x4EE3;&#x7801;&#x4ED3;&#x5E93;</strong>&#xFF1A;<a href="https://gitcode.com/nutpi/uni-idcard" target="_blank">https://gitcode.com/nutpi/uni-idcard</a></li>
</ul>
<p>&#x5E0C;&#x671B;&#x8FD9;&#x4E2A;&#x63D2;&#x4EF6;&#x80FD;&#x5BF9;&#x60A8;&#x6709;&#x6240;&#x5E2E;&#x52A9;&#xFF01;&#x5982;&#x679C;&#x60A8;&#x6709;&#x4EFB;&#x4F55;&#x95EE;&#x9898;&#x6216;&#x5EFA;&#x8BAE;&#xFF0C;&#x6B22;&#x8FCE;&#x8054;&#x7CFB;&#x3002;</p>
<h2 id="&#x76F8;&#x5173;&#x94FE;&#x63A5;"><a name="&#x76F8;&#x5173;&#x94FE;&#x63A5;" class="plugin-anchor" href="#&#x76F8;&#x5173;&#x94FE;&#x63A5;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x76F8;&#x5173;&#x94FE;&#x63A5;</h2>
<ul>
<li><a href="https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html" target="_blank">UTS &#x8BED;&#x6CD5;</a></li>
<li><a href="https://uniapp.dcloud.net.cn/plugin/uts-plugin.html" target="_blank">UTS API &#x63D2;&#x4EF6;</a></li>
<li><a href="https://gitcode.net/dcloud/hello-uts" target="_blank">Hello UTS</a></li>
<li>&#x63D2;&#x4EF6;&#x5730;&#x5740;&#xFF1A;<a href="https://ext.dcloud.net.cn/plugin?id=23728" target="_blank">https://ext.dcloud.net.cn/plugin?id=23728</a></li>
<li>&#x4ED3;&#x5E93;&#x5730;&#x5740;&#xFF1A;<a href="https://gitcode.com/nutpi/uni-idcard" target="_blank">https://gitcode.com/nutpi/uni-idcard</a></li>
</ul>
<h2 id="&#x575A;&#x679C;&#x6D3E;"><a name="&#x575A;&#x679C;&#x6D3E;" class="plugin-anchor" href="#&#x575A;&#x679C;&#x6D3E;"><i class="fa fa-link" aria-hidden="true"></i></a>&#x575A;&#x679C;&#x6D3E;</h2>
<p>&#x575A;&#x679C;&#x6D3E;&#x793E;&#x533A;&#x7531;&#x5C0F;&#x6CE2;&#x3001;&#x72FC;&#x54E5;&#x7B49;&#x4EBA;&#x521B;&#x5EFA;&#xFF0C;&#x56E2;&#x961F;&#x62E5;&#x6709;&#x6570;&#x4F4D;&#x534E;&#x4E3A;HDE&#x53CA;1000+HarmonyOS&#x5F00;&#x53D1;&#x8005;&#xFF0C;&#x4EE5;&#x53CA;&#x82E5;&#x5E72;&#x5176;&#x4ED6;&#x9886;&#x57DF;&#x7684;&#x4E09;&#x5341;&#x4F59;&#x4F4D;&#x4E07;&#x7C89;&#x535A;&#x4E3B;/UP&#x4E3B;&#x8FD0;&#x8425;&#x3002;</p>
<p>&#x4E13;&#x6CE8;&#x4E8E;&#x5206;&#x4EAB;&#x7684;&#x6280;&#x672F;&#x5305;&#x62EC;HarmonyOS/OpenHarmony&#x3001;&#x4ED3;&#x9889;&#x3001;ArkUI-X&#x3001;&#x5143;&#x670D;&#x52A1;&#x3001;AI&#x3001;BlueOS&#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x7B49;&#x3002;&#x56E2;&#x961F;&#x6210;&#x5458;&#x4E3B;&#x8981;&#x805A;&#x96C6;&#x5728;&#x5317;&#x4EAC;&#xFF0C;&#x4E0A;&#x6D77;&#xFF0C;&#x5357;&#x4EAC;&#xFF0C;&#x6DF1;&#x5733;&#xFF0C;&#x5E7F;&#x5DDE;&#xFF0C;&#x82CF;&#x5DDE;&#x3001;&#x957F;&#x6C99;&#x3001;&#x5B81;&#x590F;&#x7B49;&#x5730;&#xFF0C;&#x76EE;&#x524D;&#x5DF2;&#x4E3A;&#x534E;&#x4E3A;&#x3001;vivo&#x3001;&#x817E;&#x8BAF;&#x3001;&#x4E9A;&#x9A6C;&#x900A;&#x4EE5;&#x53CA;&#x4E09;&#x65B9;&#x6280;&#x672F;&#x793E;&#x533A;&#x63D0;&#x4F9B;&#x5404;&#x7C7B;&#x5F00;&#x53D1;&#x54A8;&#x8BE2;&#x670D;&#x52A1;100+&#x3002;&#x7D2F;&#x8BA1;&#x7C89;&#x4E1D;100+w&#xFF0C;&#x5B75;&#x5316;&#x5F00;&#x53D1;&#x8005;10w+&#xFF0C;&#x9AD8;&#x6821;20+&#x3001;&#x4F01;&#x4E1A;10+&#x3002;&#x81EA;&#x7814;&#x5E94;&#x7528;40&#x6B3E;&#xFF0C;&#x4E09;&#x65B9;&#x5E93;80&#x4E2A;&#xFF0C;&#x9E3F;&#x8499;&#x539F;&#x751F;&#x5E94;&#x7528;&#x8BFE;&#x7A0B;500+&#x3002;&#x6301;&#x7EED;&#x52A9;&#x529B;&#x9E3F;&#x8499;&#x4ED3;&#x9889;&#x7B49;&#x751F;&#x6001;&#x7E41;&#x8363;&#x53D1;&#x5C55;&#x3002;</p>
<footer class="page-footer"><span class="copyright">powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2025-06-08 21:21:26
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                </div>
                <script src="https://my.openwrite.cn/js/readmore.js"></script>
                <script>
                    var enablePlugin = false;
                    var allowDomain = "localhost";
                    if(allowDomain){
                        var currentDomain = location.hostname;
                        if ($.isArray(allowDomain)) {
                            $.each(allowDomain, function(index, item) {
                                if (currentDomain == item) {
                                    enablePlugin = true;
                                    return false;
                                }
                            });
                        }else{
                           if (currentDomain == allowDomain) {
                                enablePlugin = true;
                            }
                        }
                    }else{
                        enablePlugin = true;
                    }
                    
                    if(enablePlugin){
                        var isMobile = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
                        if (!isMobile) {
                            var btw = new BTWPlugin();
                            btw.init({"allowDomain":"localhost","blogId":"27976-1678928361372-483","name":"坚果派","qrcode":"https://luckly007.oss-cn-beijing.aliyuncs.com/images/image-20230316085818226.png","keyword":"鸿蒙坚果","id":"vip-container"});
                        }
                    }
                </script> 
          </section>
          
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>
 
          <div class="book-footer">
            
            <div class="donate">
              <div></div>
              <button class="donate-btn" onclick="showModal()">赞赏</button>
            </div>
             
            <div class="copyright"></div>
            
          </div>
          
        </div>
      </div>
      
    </div>

     
    <a
      href="1.开发鸿蒙插件.html"
      class="
        navigation navigation-prev
        
      "
      aria-label="Previous page: 7.1 开发鸿蒙插件"
    >
      <i class="fa fa-angle-left"></i>
    </a>
     
    <a
      href="3.chinese-number-format插件.html"
      class="
        navigation navigation-next
        
      "
      aria-label="Next page: 7.3 chinese-number-format插件"
    >
      <i class="fa fa-angle-right"></i>
    </a>
      
  </div>
  <script>
    function showModal() {
      document.getElementsByClassName("mask")[0].style.display = "block";
      document.getElementsByClassName("donate-modal")[0].style.display =
        "block";
    }
    // 切换赞赏码
    function showDonateImg(num) {
      let alipay = "";
      let wxpay = ""
      if(num){
        wxpay = "hidden"
      }else{
        alipay = "hidden"
      }
      document.getElementById("wxpay-code").hidden = wxpay;
      document.getElementById("alipay-code").hidden = alipay;
      document.getElementsByName("pay-way")[num].checked = "checked";
    }

    // 关闭赞赏框
    function closeDonateModal() {
      document.getElementsByClassName("mask")[0].style.display = "none";
      document.getElementsByClassName("donate-modal")[0].style.display = "none";
    }

    var gitbook = gitbook || [];
    gitbook.push(function () {
      gitbook.page.hasChanged({"page":{"title":"7.2 uniappx插件nutpi-idcard开发与使用指南","level":"1.7.2","depth":2,"next":{"title":"7.3 chinese-number-format插件","level":"1.7.3","depth":2,"path":"chapter7/3.chinese-number-format插件.md","ref":"./chapter7/3.chinese-number-format插件.md","articles":[]},"previous":{"title":"7.1 开发鸿蒙插件","level":"1.7.1","depth":2,"path":"chapter7/1.开发鸿蒙插件.md","ref":"./chapter7/1.开发鸿蒙插件.md","articles":[]},"dir":"ltr"},"config":{"plugins":["github-buttons@2.1.0","edit-link","splitter","tbfed-pagefooter","expandable-chapters","chapter-fold","back-to-top-button","code","pageview-count","popup","search-plus","-lunr","-search","splitter","-sharing","sharing-plus","theme-lou","mind-maps","emphasize","anchors","changyan","readmore","livereload","ace","livereload"],"root":".","styles":{"website":"styles/website.css"},"pluginsConfig":{"tbfed-pagefooter":{"modify_label":"该文件修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"pluginsConfig":{"expandable-chapters":{}},"emphasize":{},"ace":{},"livereload":{},"splitter":{},"readmore":{"allowDomain":"localhost","blogId":"27976-1678928361372-483","name":"坚果派","qrcode":"https://luckly007.oss-cn-beijing.aliyuncs.com/images/image-20230316085818226.png","keyword":"鸿蒙坚果"},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"popup":{},"code":{"copyButtons":true},"theme-lou":{"hide-elements":[".summary .gitbook-link",".summary .divider"],"color":"#FF4848","book-anchor-title":"本章目录","copyright":{"author":"vx:nut_pie"},"forbidCopy":true,"logo":"assets/avatar.png","book-summary-title":"文章目录","search-placeholder":"输入关键字搜索","copyrightLogo":"assets/copyright.png","favicon":"assets/avatar.png","appleTouchIconPrecomposed152":"assets/avatar.png"},"changyan":{"appid":"cyvHoCPAs","conf":"0440cfc4168ba95d73cfc52dd4d5c60b"},"fontsettings":{"theme":"white","family":"sans","size":2},"mind-maps":{},"highlight":{},"back-to-top-button":{},"pageview-count":{},"github-buttons":{"repo":"ITmxs/gitbook","types":["star","watch","fork"],"size":"small"},"sharing":{"qq":false,"all":["qq","qzone","whatsapp","douban","facebook","google","instapaper","linkedin","messenger","twitter","weibo"],"douban":false,"facebook":false,"weibo":false,"twitter":false,"pocket":false,"google":false,"qzone":false},"edit-link":{"label":"编辑此页","base":"https://github.com/ITmxs/gitbook/edit/master/"},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"anchors":{},"expandable-chapters":{},"search-plus":{}},"theme":"default","author":"坚果派","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{"themeLou":{"nav":[{"target":"_blank","url":"https://www.nutpi.net/","name":"坚果派官网"},{"target":"_blank","url":"https://www.arkui.club/","name":"ArkUI实战"},{"target":"_blank","url":"https://space.bilibili.com/480883651","name":"元服务开发实践"},{"target":"_blank","url":"https://gitcode.com/nutpi","name":"OpenHarmony应用开发"}],"footer":{"donate":{"wechat":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png","message":"随意打赏，但不要超过一顿早餐钱 💕","wxpay":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202901895.png","alipay":"https://luckly007.oss-cn-beijing.aliyuncs.com/img/image-20210922202843746.png","nickname":"breeze","button":"打赏","wechatText":"微信","alipayText":"支付宝","title":"『赠人玫瑰 🌹 手有余香 』","avatar":"http://xkapp-uat.oss-cn-hangzhou.aliyuncs.com/2e7a3f70-80ab-4b50-93ec-a04dfeef949b/avatar-100.png"},"copyright":true}}},"title":"uniapp/uniapp-x for Harmony教程","language":"zh-hans","gitbook":"*","description":"uniapp/uniapp-x for Harmony电子书教程"},"file":{"path":"chapter7/2.uniappx插件nutpi-idcard 开发与使用指南（适配鸿蒙）.md","mtime":"2025-06-08T13:21:26.743Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2025-06-30T01:19:14.211Z"},"basePath":"..","book":{"language":""}});
    });
  </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-edit-link/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-mind-maps/mindmaps.dist.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-changyan/changyan.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ace/ace/ace.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-ace/ace.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-theme-lou/lou.js"></script>
        
    

    </body>
</html>

